//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_kickplayerbs.sqf"
#include "x_setup.sqf"

private ["_pl", "_uid", "_reason"];
PARAMS_3(_pl,_pl_name,_reason);
_uid = getPlayerUID _pl;
serverCommand ("#kick " + _pl_name);
[QGVAR(em), [_pl]] call FUNC(NetCallEventSTO);
if (_reason != -1) then {
	switch (_reason) do {
		case 0: {
			diag_log format [(localize "STR_DOM_MISSIONSTRING_943"), _pl_name, _uid];
		};
		case 1: {
			diag_log format [(localize "STR_DOM_MISSIONSTRING_944"), _pl_name, _uid];
		};
		case 2: {
			diag_log format [(localize "STR_DOM_MISSIONSTRING_945"), _pl_name, _uid];
		};
		case 3: {
			diag_log format [(localize "STR_DOM_MISSIONSTRING_946"), _pl_name, _uid];
		};
	};
	[QGVAR(ps_an), [_pl_name, _reason]] call FUNC(NetCallEventToClients);
};